<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QHttpRequestHeader Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QHttpRequestHeader Class Reference<br /><sup><sup>[<a href="qtnetwork.html">QtNetwork</a> module]</sup></sup></h1><p>The QHttpRequestHeader class contains request header information
for HTTP. <a href="#details">More...</a></p>

<p>Inherits <a href="qhttpheader.html">QHttpHeader</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qhttprequestheader.html#QHttpRequestHeader">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qhttprequestheader.html#QHttpRequestHeader-2">__init__</a></b> (<i>self</i>, QString&#160;<i>method</i>, QString&#160;<i>path</i>, int&#160;<i>major</i>&#160;=&#160;1, int&#160;<i>minor</i>&#160;=&#160;1)</li><li><div class="fn" /><b><a href="qhttprequestheader.html#QHttpRequestHeader-3">__init__</a></b> (<i>self</i>, QHttpRequestHeader&#160;<i>header</i>)</li><li><div class="fn" /><b><a href="qhttprequestheader.html#QHttpRequestHeader-4">__init__</a></b> (<i>self</i>, QString&#160;<i>str</i>)</li><li><div class="fn" />int <b><a href="qhttprequestheader.html#majorVersion">majorVersion</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qhttprequestheader.html#method">method</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qhttprequestheader.html#minorVersion">minorVersion</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qhttprequestheader.html#parseLine">parseLine</a></b> (<i>self</i>, QString&#160;<i>line</i>, int&#160;<i>number</i>)</li><li><div class="fn" />QString <b><a href="qhttprequestheader.html#path">path</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qhttprequestheader.html#setRequest">setRequest</a></b> (<i>self</i>, QString&#160;<i>method</i>, QString&#160;<i>path</i>, int&#160;<i>major</i>&#160;=&#160;1, int&#160;<i>minor</i>&#160;=&#160;1)</li><li><div class="fn" />QString <b><a href="qhttprequestheader.html#toString">toString</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QHttpRequestHeader class contains request header information
for HTTP.</p>
<p>This class is used in the <a href="qhttp.html">QHttp</a> class
to report the header information if the client requests something
from the server.</p>
<p>HTTP requests have a method which describes the request's
action. The most common requests are "GET" and "POST". In addition
to the request method the header also includes a request-URI to
specify the location for the method to use.</p>
<p>The method, request-URI and protocol-version can be set using a
constructor or later using <a href="qhttprequestheader.html#setRequest">setRequest</a>(). The values
can be obtained using <a href="qhttprequestheader.html#method">method</a>(), <a href="qhttprequestheader.html#pathx">path</a>(), <a href="qhttprequestheader.html#majorVersion">majorVersion</a>() and
<a href="qhttprequestheader.html#minorVersion">minorVersion</a>().</p>
<p>Note that the request-URI must be in the format expected by the
HTTP server. That is, all reserved characters must be encoded in
%HH (where HH are two hexadecimal digits). See <a href="qurl.html#toPercentEncoding">QUrl.toPercentEncoding</a>() for
more information.</p>
<p>Important inherited functions: <a href="qhttpheader.html#setValue">setValue</a>() and <a href="qhttpheader.html#value">value</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QHttpRequestHeader" />QHttpRequestHeader.__init__ (<i>self</i>)</h3><p>Constructs an empty HTTP request header.</p>


<h3 class="fn"><a name="QHttpRequestHeader-2" />QHttpRequestHeader.__init__ (<i>self</i>, QString&#160;<i>method</i>, QString&#160;<i>path</i>, int&#160;<i>major</i>&#160;=&#160;1, int&#160;<i>minor</i>&#160;=&#160;1)</h3><p>Constructs a HTTP request header for the method <i>method</i>,
the request-URI <i>path</i> and the protocol-version
<i>majorVer</i> and <i>minorVer</i>. The <i>path</i> argument must
be properly encoded for an HTTP request.</p>


<h3 class="fn"><a name="QHttpRequestHeader-3" />QHttpRequestHeader.__init__ (<i>self</i>, <a href="qhttprequestheader.html">QHttpRequestHeader</a>&#160;<i>header</i>)</h3><p>Constructs a copy of <i>header</i>.</p>


<h3 class="fn"><a name="QHttpRequestHeader-4" />QHttpRequestHeader.__init__ (<i>self</i>, QString&#160;<i>str</i>)</h3><p>Constructs a HTTP request header from the string <i>str</i>. The
<i>str</i> should consist of one or more "\r\n" delimited lines;
the first line should be the request-line (format: method, space,
request-URI, space HTTP-version); each of the remaining lines
should have the format key, colon, space, value.</p>


<h3 class="fn"><a name="majorVersion" />int QHttpRequestHeader.majorVersion (<i>self</i>)</h3><p>Reimplemented from <a href="qhttpheader.html#majorVersion">QHttpHeader.majorVersion</a>().</p>
<p>Returns the major protocol-version of the HTTP request
header.</p>
<p><b>See also</b> <a href="qhttprequestheader.html#minorVersion">minorVersion</a>(), <a href="qhttprequestheader.html#method">method</a>(), <a href="qhttprequestheader.html#pathx">path</a>(), and <a href="qhttprequestheader.html#setRequest">setRequest</a>().</p>


<h3 class="fn"><a name="method" />QString QHttpRequestHeader.method (<i>self</i>)</h3><p>Returns the method of the HTTP request header.</p>
<p><b>See also</b> <a href="qhttprequestheader.html#pathx">path</a>(), <a href="qhttprequestheader.html#majorVersion">majorVersion</a>(), <a href="qhttprequestheader.html#minorVersion">minorVersion</a>(), and
<a href="qhttprequestheader.html#setRequest">setRequest</a>().</p>


<h3 class="fn"><a name="minorVersion" />int QHttpRequestHeader.minorVersion (<i>self</i>)</h3><p>Reimplemented from <a href="qhttpheader.html#minorVersion">QHttpHeader.minorVersion</a>().</p>
<p>Returns the minor protocol-version of the HTTP request
header.</p>
<p><b>See also</b> <a href="qhttprequestheader.html#majorVersion">majorVersion</a>(), <a href="qhttprequestheader.html#method">method</a>(), <a href="qhttprequestheader.html#pathx">path</a>(), and <a href="qhttprequestheader.html#setRequest">setRequest</a>().</p>


<h3 class="fn"><a name="parseLine" />bool QHttpRequestHeader.parseLine (<i>self</i>, QString&#160;<i>line</i>, int&#160;<i>number</i>)</h3><h3 class="fn"><a name="path" />QString QHttpRequestHeader.path (<i>self</i>)</h3><h3 class="fn"><a name="setRequest" />QHttpRequestHeader.setRequest (<i>self</i>, QString&#160;<i>method</i>, QString&#160;<i>path</i>, int&#160;<i>major</i>&#160;=&#160;1, int&#160;<i>minor</i>&#160;=&#160;1)</h3><p>This function sets the request method to <i>method</i>, the
request-URI to <i>path</i> and the protocol-version to
<i>majorVer</i> and <i>minorVer</i>. The <i>path</i> argument must
be properly encoded for an HTTP request.</p>
<p><b>See also</b> <a href="qhttprequestheader.html#method">method</a>(), <a href="qhttprequestheader.html#pathx">path</a>(), <a href="qhttprequestheader.html#majorVersion">majorVersion</a>(), and
<a href="qhttprequestheader.html#minorVersion">minorVersion</a>().</p>


<h3 class="fn"><a name="toString" />QString QHttpRequestHeader.toString (<i>self</i>)</h3><p>Reimplemented from <a href="qhttpheader.html#toString">QHttpHeader.toString</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>